//
//  MessageObjects.swift
//  SecretChat
//
//  Created by TimTiger on 16/7/13.
//  Copyright © 2016年 TimTiger. All rights reserved.
//

import UIKit
import SCMessageSDK
import MudFramework

private let MessageTextKey = "text"
private let MessageSenderKey = "sender"
private let MessageReceiverKey = "receiver"

/// 基本消息
public class SCBaseMessage : SCBaseObject {
    /** 文字消息 */
    public lazy var text: String = ""
    public lazy var sender: SCUserInfo = SCUserInfo()
    public lazy var receiver: [SCUserInfo] = [SCUserInfo]()
    
    public func convertToDictionary()->MudParameters {
        var parameters = MudParameters()
        parameters.setParameter(self.text, forKey: MessageTextKey)
        parameters.setParameter(self.sender.userID, forKey: MessageSenderKey)
        return parameters
    }
}